cmake_minimum_required(VERSION 3.0)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS false)
set(CMAKE_LINK_SEARCH_START_STATIC true)
set(CMAKE_LINK_SEARCH_END_STATIC true)

project(cpplib-test)
add_compile_options(-Wall)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
        add_compile_options(-Wno-invalid-source-encoding)
endif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")

include_directories(. ${CMAKE_CURRENT_LIST_DIR}/doctest/doctest)

add_executable(function function.cpp)
add_executable(VSTOPtr VSTOPtr.cpp)
add_executable(DigitEditStr DigitEditStr.cpp pw_pbl/DigitEditStr.cpp)
add_executable(RefArray RefArray.cpp)
add_executable(DeviceRegister20 DeviceRegister20.cpp)
add_executable(Coroutine Coroutine.cpp)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
        target_compile_options(Coroutine PRIVATE -fcoroutines-ts -stdlib=libc++)
    else()
        target_compile_options(Coroutine PRIVATE -fcoroutines)
endif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
